package com.wdg.controller;

import com.wdg.pojo.Student_info;
import com.wdg.pojo.UserVO;
import com.wdg.dao.StudentInfoDao;
import com.wdg.dao.impl.StudentInfoImpl;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@Controller
public class CombQuController {
    @RequestMapping("/Comb_Qu.action")
    public String selectUserField(HttpServletRequest request, HttpServletResponse response, UserVO uv) {

        System.out.println(uv.getSex());
        System.out.println(uv.getScore_cmp());
        System.out.println(uv.getUsername());
        System.out.println(uv.getAddress());
        System.out.println(uv.getScore_cmp());
        StudentInfoDao sid = new StudentInfoImpl();

        List<Student_info> sis = sid.select_UserInfo(uv);

        for(Student_info si : sis) {
            System.out.println(si.getAddress());
        }

        request.setAttribute("stu_list", sis);
        return "Comb_Qu";
    }
}
